//
//  UIButton+OperatingInternalSpace.m
//  XLPersonCenter
//
//  Created by 宋振 on 2018/7/23.
//  Copyright © 2018年 夜幕繁华. All rights reserved.
//

#import "UIButton+OperatingInternalSpace.h"

@implementation UIButton (OperatingInternalSpace)

/**
 区头标签设置
 */
- (void)setLabelViewWithButton:(UIButton *)button title:(NSString *)title image:(NSString *)imageName fontName:(NSString *)fontName fontSize:(CGFloat)fontSize cornerRadius:(CGFloat)radius
{
    NSDictionary *attributes = @{
                                 NSFontAttributeName:[UIFont fontWithName:fontName size:fontSize],
                                 NSForegroundColorAttributeName:[UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1]
                                 };
    
    NSAttributedString *attribute = [[NSAttributedString alloc] initWithString:title attributes:attributes];
    
    [self setAttributedTitle:attribute forState:(UIControlStateNormal)];
    
    [self setImage:[UIImage imageNamed:imageName] forState:(UIControlStateNormal)];
    
    self.layer.cornerRadius = radius;
    self.layer.masksToBounds = YES;
    
}



@end
